/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.time.LocalDate;
import java.util.Arrays;

/**
 * <p>Project: jse2303 - ArrSort4
 * <p>Powered by webrx On 2023-07-12 14:06:16
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class ArrSort5 {
    public static void main(String[] args) {
        Student[] ss = new Student[]{new Student(10, "李四", LocalDate.of(2001, 3, 16), 90), new Student(25, "张三丰", LocalDate.of(2012, 9, 15), 30), new Student(12, "赵六", LocalDate.of(1998, 3, 16), 95), new Student(35, "李现", LocalDate.of(2020, 9, 15), 80), new Student(66, "周勇", LocalDate.of(2010, 7, 21), 10)};
        //Arrays.sort(ss); 报异常原因Student对象类没有实现 Comparable<Student> 接口

        //Arrays.sort(ss, (a, b) -> b.getScore() -
        //Arrays.sort(ss, (a, b) -> b.getBirth().compareTo(a.getBirth()));

        //Arrays.sort(ss, (a, b) -> a.getName().compareTo(b.getName()));

        Arrays.sort(ss);
        System.out.println(Arrays.toString(ss));
    }
}
